home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-11-24 | 1.1 KB | 45 lines | [TEXT/GEOL] |
- Item forwarded by A33 to A34
-
- Item 4549772 20-Nov-89 17:32
-
- From: SCHMUCKER1 Schmucker, Kurt
-
- To: MID France, Dev, MID/Nautil
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: Re: InvalRgn in TView
-
- Etienne,
-
- For what it is worth, I also felt that an InvalRgn was a very useful
- addition to MacApp. Here is the code I wrote (it seems to work ok):
-
- {$S ARes}
- PROCEDURE TMyView.InvalidRegion(rgn: RgnHandle);
- VAR
- tempRgn:RgnHandle;
- visRect:Rect;
- viewRect: VRect;
-
- BEGIN
- IF Focus
- THEN BEGIN
- { Get a rect in view coordinates representing the visible portion of the
- view }
- SELF.GetVisibleRect(visRect);
- SELF.QDToViewRect(visRect, viewRect);
- VRectToRect(viewRect, visRect);
-
- { Find the intersection of the vis region and the desired inval region }
- tempRgn := NewRgn;
- RectRgn(tempRgn, visRect);
- SectRgn(tempRgn, rgn, tempRgn);
-
- InvalRgn(tempRgn);
-
- DisposeRgn(tempRgn);
- END;
- END; { TMyView.InvalidRect }
-
-